<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>清洗（删除）已经存储的所有的元素</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="memcache.delete.html">Memcache::delete</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="memcache.get.html">Memcache::get</a></div>
 <div class="up"><a href="class.memcache.html">Memcache</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="memcache.flush" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcache::flush</h1>
  <p class="verinfo">(PECL memcache &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Memcache::flush</span> &mdash; <span class="dc-title">清洗（删除）已经存储的所有的元素</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcache.flush-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>Memcache::flush</strong></span>
    ( <span class="methodparam">void</span>
   )</div>


  <p class="para rdfs-comment">
   <span class="function"><strong>Memcache::flush()</strong></span>立即使所有已经存在的元素失效。方法<span class="function"><strong>Memcache::flush()</strong></span>
   并不会真正的释放任何资源，而是仅仅标记所有元素都失效了，因此已经被使用的内存会被新的元素复写。
   同样你也可以使用函数<span class="function"><strong>memcache_flush()</strong></span>完成相同功能。
  </p>

 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-memcache.flush-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-memcache.flush-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4321">
    <p><strong>Example #1 <span class="function"><strong>Memcache::flush()</strong></span>示例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*&nbsp;procedural&nbsp;API&nbsp;*/<br /></span><span style="color: #0000BB">$memcache_obj&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">memcache_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">memcache_flush</span><span style="color: #007700">(</span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;OO&nbsp;API&nbsp;*/<br /><br /></span><span style="color: #0000BB">$memcache_obj&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Memcache</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'memcache_host'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">11211</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$memcache_obj</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">flush</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="memcache.delete.html">Memcache::delete</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="memcache.get.html">Memcache::get</a></div>
 <div class="up"><a href="class.memcache.html">Memcache</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
